package com.hzncc.flowable_diboot.contract.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
* 合同产品物料技术清单 Entity 定义
* @author MyName
* @version 1.0
* @date 2024-07-12
* Copyright © MyCorp
*/

@TableName("mdl_contract_product_material")
@Getter @Setter @Accessors(chain = true)
@ToString
@EqualsAndHashCode(callSuper = false)
public class ContractProductMaterial extends BaseModel {
    private static final long serialVersionUID = 1494716132307612317L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 合同产品ID
     */
    @NotNull(message = "合同产品ID不能为空")
    @TableField()
    private String contractProductId;

    /**
     * 合同编码
     */
    @NotNull(message = "合同编码不能为空")
    @Length(max=100, message="合同编码长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String contractCode;

    /**
     * 合同版本号
     */
    @NotNull(message = "合同版本号不能为空")
    @Length(max=100, message="合同版本号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private Long contractVersion;

    /**
     * 产品编码
     */
    @NotNull(message = "产品编码不能为空")
    @Length(max=100, message="产品编码长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String productCode;

    /**
     * 产品规格
     */
    @NotNull(message = "产品规格不能为空")
    @Length(max=100, message="产品规格长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String productType;

    /**
     * 物料编码
     */
    @NotNull(message = "物料编码不能为空")
    @Length(max=100, message="物料编码长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String materialCode;

    /**
     * 物料功能描述
     */
    @Length(max=100, message="物料功能描述长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String materialDesc;

    /**
     * 物料单价
     */
    @NotNull(message = "物料单价不能为空")
    @TableField()
    private BigDecimal materialPrice;

    /**
     * 物料数量
     */
    @NotNull(message = "物料数量不能为空")
    @TableField()
    private Long materialCount;

    /**
     * 物料折扣
     */
    @NotNull(message = "物料折扣不能为空")
    @TableField()
    private BigDecimal materialDiscount;

    /**
     * 物料总价格
     */
    @NotNull(message = "物料总价格不能为空")
    @TableField()
    private BigDecimal materialTotalPrice;

    /**
     * 备注
     */
    @Length(max=100, message="备注长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String remark;

    /**
     * 实际折扣
     */
    @TableField()
    private BigDecimal actualDiscount;

    /**
     * 行号
     */
    @TableField
    private String rowNum;
}